﻿using MiniFox.Platform.Resources;
using MiniFox.Resources;
using System.ComponentModel.DataAnnotations;

namespace MiniFox.Platform.OAuth2.Models
{
    /// <summary>
    /// 注册请求
    /// </summary>
    public class Register
    {
        /// <summary>
        /// 注册用户名
        /// </summary>
        [Display(Name = "LAB_LoginName", Prompt = "LAB_LoginName", Description = "DESC_RegexLoginName", ResourceType = typeof(Resources.ResMessage))]
        [SecureString(SecureStringType.LoginName, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string LoginName { get; set; }

        /// <summary>
        /// 注册邮箱
        /// </summary>
        [Display(Name = "LAB_SecMail", Prompt = "LAB_SecMail", ResourceType = typeof(Resources.ResMessage))]
        [SecureString(SecureStringType.Email, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string SecEmail { get; set; }

        /// <summary>
        /// 注册手机
        /// </summary>
        [Display(Name = "LAB_Cellphone", Prompt = "LAB_Cellphone", ResourceType = typeof(Resources.ResMessage))]
        [SecureString(SecureStringType.Cellphone, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string Cellphone { get; set; }

        /// <summary>
        /// 登录密码
        /// </summary>
        [Display(Name = "LAB_Password", Prompt = "LAB_Password", Description = "DESC_RegexPassword", ResourceType = typeof(ResMessage))]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [SecureString(SecureStringType.Password, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string Password { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [Display(Name = "LAB_ConfirmPwd", Prompt = "LAB_ConfirmPwd", ResourceType = typeof(ResMessage))]
        [DataType(DataType.Password)]
        [Compare("Password", ErrorMessageResourceType = typeof(Resources.ResMessage), ErrorMessageResourceName = "ERR_UnmatchConfirmPassword")]
        public string ConfirmPassword { get; set; }
    }

    /// <summary>
    /// 用户名+密码注册
    /// </summary>
    public class RegisterLoginName
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Display(Name = "LAB_LoginName", Prompt = "LAB_LoginName", Description = "DESC_RegexLoginName", ResourceType = typeof(ResMessage))]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [SecureString(SecureStringType.LoginName, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string LoginName { get; set; }

        /// <summary>
        /// 登录密码
        /// </summary>
        [Display(Name = "LAB_Password", Prompt = "LAB_Password", Description = "DESC_RegexPassword", ResourceType = typeof(ResMessage))]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [SecureString(SecureStringType.Password, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string Password { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name = "LAB_ConfirmPwd", Prompt = "LAB_ConfirmPwd", ResourceType = typeof(ResMessage))]
        [DataType(DataType.Password)]
        [Compare("Password", ErrorMessageResourceType = typeof(ResMessage), ErrorMessageResourceName = "ERR_UnmatchConfirmPassword")]
        public string ConfirmPassword { get; set; }
    }

    /// <summary>
    /// 安全邮箱+密码注册
    /// </summary>
    public class RegisterEmail
    {
        /// <summary>
        /// 注册邮箱
        /// </summary>
        [Display(Name = "LAB_SecMail", Prompt = "LAB_SecMail", ResourceType = typeof(ResMessage))]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [SecureString(SecureStringType.Email, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string SecEmail { get; set; }
        /// <summary>
        /// 登录密码
        /// </summary>
        [Display(Name = "LAB_Password", Prompt = "LAB_Password", Description = "DESC_RegexPassword", ResourceType = typeof(ResMessage))]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [SecureString(SecureStringType.Password, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonUnmatchRegex")]
        public string Password { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name = "LAB_ConfirmPwd", Prompt = "LAB_ConfirmPwd", ResourceType = typeof(ResMessage))]
        [DataType(DataType.Password)]
        [Compare("Password", ErrorMessageResourceType = typeof(ResMessage), ErrorMessageResourceName = "ERR_UnmatchConfirmPassword")]
        public string ConfirmPassword { get; set; }
    }

}
